#!usr/bin/env python  
# -*- coding:utf-8 -*-
from .models import EmailVerifyRecord,Banner
import xadmin
from xadmin import views
# 更换xadmin默认主题
class BaseSetting(object):
    enable_themes = True
    use_bootswatch = True
xadmin.site.register(views.BaseAdminView,BaseSetting)

# 修改左上角和底部logo
class GlobalSettings(object):
    site_title = '幕学网后台管理系统'
    site_footer = '幕学在线网'
    menu_style = 'accordion'
xadmin.site.register(views.CommAdminView,GlobalSettings)

class EmailVerifyRecordAdmin(object):
    list_display = ['code','email','send_type','send_time']
    search_fields = ['code','email','send_type']
    list_filter = ['code','email','send_type','send_time']
xadmin.site.register(EmailVerifyRecord,EmailVerifyRecordAdmin)

class BannerAdmin(object):
    list_display = ['title','image','url','index','add_time']
    search_fields = ['title','image','url','index']
    list_filter = ['title','image','url','index','add_time']
xadmin.site.register(Banner,BannerAdmin)
